package org.example.dao.impl;

import org.apache.ibatis.session.RowBounds;
import org.example.dao.IUserDao;
import org.example.entity.AuthUserEntity;
import org.example.entity.UserEntity;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserDaoImpl implements IUserDao {
    private static final String DAO = "org.example.mapper.User.";
    @Autowired
    private SqlSessionTemplate template;

    @Override
    public List<UserEntity> selectList(UserEntity entity,RowBounds rowBounds){
        if(rowBounds == null){
            return template.selectList(DAO+"selectList");
        }
        return template.selectList(DAO+"selectList",entity,rowBounds);
    }
    @Override
    public Integer selectCount(UserEntity entity){
        return template.selectOne(DAO+"selectCount",entity);
    }
}
